#ifndef WII_GI_C_SPRITE_RESOURCE_H
#define WII_GI_C_SPRITE_RESOURCE_H

#include "c_Resource.h"
#include "c_ResourceMgr.h"
#include "c_Sprite.h"

namespace wiigi
{
   class c_SpriteResource : public c_Resource
   {
      public:
         
         c_SpriteResource( c_ResourceMgr* ResourceMgr );
         
         virtual ~c_SpriteResource()
         {
            purge();
            printf( "~c_SpriteResource()\n" );
         }
         
         bool setParameter( const std::string& ParameterName, const std::string& ParameterValue );
         
         
         c_Sprite* createSprite( void );
         bool        freeSprite( c_Sprite* DeadSprite );
         
         bool cache( void );
         bool purge( void );
      
      private:
         void setTextureName( const std::string& TextureName );
         void setSubRect( const std::string& SubRect );
         void setFrameCnt( const std::string& FrameCnt );
            
      private:
         
         std::string m_TextureName;
         bool        m_TextureName_Set;
            
         c_u32Rect   m_SubRect;
         bool        m_SubRect_Set;
         
         u16         m_FrameCnt;
         u16         m_FrameCnt_Set;
         
      private:
         std::list<c_Sprite*> m_Sprites;
            
   };
   
}


#endif //WII_GI_C_SPRITE_RESOURCE_H
